package demo1;

import demo1.subClass.MallardDuck;
import demo1.subClass.ModelDuck;
import org.junit.Test;

/**
 * @author 24岁没牵过女人的手
 * 日期：2023/6/19 16:43
 * 文件描述：
 */
public class testDuck {

    @Test
    public void testMallardDuck(){
        Duck mallardDuck = new MallardDuck();
        mallardDuck.performFly();
        mallardDuck.performQuack();
    }

    @Test
    public void testModelDuck() {
        Duck modelDuck = new ModelDuck();
        modelDuck.setFlyBehavior(new FlyWithRocket());
        modelDuck.performFly();
    }
}
